package com.friend.chat.base

import androidx.viewbinding.ViewBinding

/**
 * @des
 * @date 2021/9/23
 * @author gorilla
 */
abstract class BaseActivity<VB : ViewBinding, VM : BasicViewModel> : EmptyBaseActivity<VB>() {
    protected val mVModel: VM by lazy { yourViewModel() }
    abstract fun yourViewModel(): VM

    override fun onNetListener() {
        super.onNetListener()
        mVModel.loadStatus.observe(this) {
            when (it) {
                LoadState.RUNNING -> {
                    showLoadingView()
                }
                LoadState.OVER -> {
                    hideLoadingView()
                }
                else -> {

                }
            }
        }

    }

}